<template>
	<view class="content">
		<view class="message">
			<view class="top">
				<view class="title">重复观看</view>
				<view class="end-title">
					恭喜{{info.username}}答题全部正确，请<text>截图</text>给<text>{{info.shop_name}}店长</text>领取答题红包～
				</view>
				<view class="video-info">
					<view class="video-title">观看视频：{{info.video_title}}</view>
					<view class="video-end-date">观看视频时间：{{info.end_time}}</view>
				</view>
			</view>
			<view class="button" @click="to_index()">人康课堂</view>
			<view class="date">{{end_time}}s后自动跳转~</view>
		</view>
	</view>
</template>

<script>
	export default {
		name:"newAnswerRepeat",
		props:["time",'info'],
		data() {
			return {
				end_time:""
			};
		},
		created() {
		    this.end_time=this.time;
			var _this=this;
			var daojishi=setInterval(function(){
				_this.end_time=_this.end_time-1;
				if(_this.end_time<=0){
					clearInterval(daojishi)
					_this.to_index()
				}
				
			},1000)
		},
		methods:{
			to_index()
			{
				uni.switchTab({
					url:"/pages/sindex/index"
				})
			}
		}
	}
</script>

<style scoped>
.content {
		width: 100%;
		height: 100vh;
		background-color: rgba(0, 0, 0, 0.5);
		position: fixed;
		top: 0;
		left: 0;
		z-index: 10;
		display: flex;
		align-items: center;
		justify-content: center;
	}

	.message {
		width: 580upx;
		box-sizing: border-box;
		padding: 40upx 44upx;
		background-color: #fff;
		border-radius: 24upx;
		position: relative;
	}
	.top{
		width: 100%;
		background-color: #fff;
		box-sizing: border-box;
		display: flex;
		flex-direction: column;
		align-items: center;
		justify-content: center;
	}
	.top .icon{
		width: 176upx;
		height: 206upx;
		background-color: red;
		margin-bottom: 20upx;
	}
	.top .end-title{
		color: #333;
		font-size: 34upx;
		font-weight: 400;
		line-height: 48upx;
		margin-bottom: 40upx;
	}
	.top .end-title text{
		color: #FB7400;
	}
	.top .video-info{
		width: 100%;
		background-color: #F8F8F8;
		border-radius: 4upx;
		box-sizing: border-box;
		padding: 20upx 40upx;
		font-size: 32upx;
		color: #333;
		font-weight: 400;
		
	}
	.video-end-date{
		font-size: 28upx;
		color: #999999;
		margin-top: 20upx;
	}
	.button {
		width: 100%;
		height: 90upx;
		background-color: #5CAE77;
		color: #fff;
		font-size: 32upx;
		font-weight: 700;
		line-height: 90upx;
		text-align: center;
		border-radius: 45upx;
		margin-top: 20upx;
	}
	.title{
		width: 100%;
		font-size: 40upx;
		color: #333;
		font-weight: 700;
		text-align: center;
		margin-bottom: 8upx;
	}
	.date{
		width: 100%;
		font-size: 28upx;
		color: #999999;
		margin-top: 40upx;
		text-align: center;
	}
</style>